<template>
  <myFrame :sideBarItems="sideBarItems">
    <section id="bg" slot="background">
      <div class="bgWrapper">
      </div>
    </section>
    <router-view slot="content"></router-view>
  </myFrame>
</template>
<script>
  import myFrame from '../widget/frame.vue'

  export default{
    components:{
      'myFrame':myFrame,
    },
    data(){
      return {
        sideBarItems:[
          { label: '麻辣观点', url:'/base/news/opinions',},
          { label: '情感培训室', url:'/base/news/loveRoom',},
          { label: '柔软时光',url:'/base/news/softTime',},
          { label: '幸福就在当下',url:'/base/news/happyNow',},
        ]
      }
    },
//    beforeRouteUpdate(to,from,next){
//      console.log('update',to);
//      if(!to.params.type){
//        this.$router.replace('/new/opinions');
//      }
//      next();
//    },
//    created(){
//      console.log('create',this.$route);
//      if(!this.$route.params.type){
//        this.$router.replace('/new/opinions');
//      }
//    }
  }
</script>
<style scoped>
  #bg{
    height:400px;
    background-image: url("../assets/home_bg.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    margin:15px 100px;
  }
</style>